'''
Created on Mar 12, 2010

@author: Roni
'''
from cliques.closest.ongoingMemberSearch import OngoingMemberSearch

class OngoingBreadthFirstSearch(OngoingMemberSearch):
    '''
    An anytime k-clique search algorithm using Breadth-First search order.
    '''
    
    def __init__(self):
        OngoingMemberSearch.__init__(self)
        
    def calculate_node_value(self,node):
        ''' Return the cost function for this node '''
        return self.g[node]  
    
    def expand(self, node):
        OngoingMemberSearch.expand(self, node)
        self.notify_member_listeners(node)
        self.found_members.add(node)
      